home *** CD-ROM | disk | FTP | other *** search
- /*****
- *
- * MemoryUtil.c
- *
- *****/
-
- #include "MemoryUtil.h"
-
-
- Handle
- MyNewHandleClear ( long theSize, OSErr *theErr )
- {
- Handle theHandle;
- OSErr myErr;
-
- theHandle = NewHandleClear ( theSize );
- myErr = MemError ();
-
- if ( *theErr != nil )
- {
- *theErr = myErr;
- }
-
- if ( myErr != noErr )
- {
- return nil;
- }
- else
- {
- return theHandle;
- }
- }
-
-
- Ptr
- MyNewPtr ( long theSize, OSErr *theErr )
- {
- Ptr thePtr;
- OSErr myErr;
-
- thePtr = NewPtr ( theSize );
- myErr = MemError ();
-
- if ( *theErr != nil )
- {
- *theErr = myErr;
- }
-
- if ( myErr != noErr )
- {
- return nil;
- }
- else
- {
- return thePtr;
- }
- }
-
-
-